import SvgIcon from './SvgIcon/index.vue'
//引入element-plus提供全部图标组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const components = { SvgIcon }
export default {
  install(app) {
    Object.keys(components).forEach((key) => {
      app.component(key, components[key])
    })
    //将element-plus提供图标注册为全局组件
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      // app.component(key, component)
      if ("Menu" !== key) {//如果不是图标组件不是Menu，就跳过，否则加上ICon的后缀
        app.component(key, component)
      } else {
        app.component(key + "Icon", component);
      }

    }
  },
}
